<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Vue指令v-on</title>
    <script src="js/vue.js"></script>
</head>
<body>

<!--2.编写视图-->
<div id="app">
    <input type="button" value="我是按钮1" v-on:click="show()"><br/>
    <input type="button" value="我是按钮2" @click="show()"><br/>
</div>

<script>
    // 1.创建Vue对象, el找到vue操作的的标签, data是vue中的数据
    new Vue({
        el: "#app",
        data: {
            username: "",
            url: "http://www.itcast.cn"
        },
        methods: {
            show() {
                alert("你点击了, vue绑定事件")
            }
        }
    });
</script>
</body>
</html>